from flask import Flask
from app.views import app_blueprint as bp
from exts import db, bcrypt, login_manager
from flask_wtf import CSRFProtect
from flask_excel import init_excel
import config



def create_app():
    app = Flask(__name__)
    app.config.from_object(config)
    app.register_blueprint(bp)
    db.init_app(app)
    bcrypt.init_app(app)
    login_manager.init_app(app)
    # cli.init_app(app)
    init_excel(app)
    CSRFProtect(app)

    return app


if __name__ == '__main__':
    app = create_app()
    app.run(host='0.0.0.0',debug=True)
    # app.run()
